home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Frameworks / TransSkel 3.24 / Source / SkelPause.c < prev    next >
Text File  |  1996-01-17  |  711b  |  31 lines

  1. /*
  2.  * SkelPause ()
  3.  *
  4.  * Pause process execution for the given length of time, measured in ticks
  5.  * (60ths of a second).  If running in a multitasking environment, gives
  6.  * time to other processes, using the wait value that's appropriate for
  7.  * whether the application's in the foreground or background.
  8.  */
  9.  
  10. # include    "TransSkel.h"
  11.  
  12.  
  13. pascal void
  14. SkelPause (long ticks)
  15. {
  16. long    current;
  17. long    waitTime;
  18. EventRecord    event;
  19.  
  20.     if (SkelQuery (skelQInForeground))
  21.         SkelGetWaitTimes (&waitTime, (long *) nil);
  22.     else
  23.         SkelGetWaitTimes ((long *) nil, &waitTime);
  24.     current = TickCount ();
  25.     while (TickCount () < current + ticks)
  26.     {
  27.         if (SkelQuery (skelQHasWNE))
  28.             (void) WaitNextEvent (0, &event, waitTime, nil);
  29.     }
  30. }
  31.